<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <script>
        window.onload = function(){
            var my_div = document.getElementById('div-1')

            // 读取标签文本信息
            console.log(my_div.innerHTML)

            // 修改文本信息
            my_div.innerHTML = '修改后的div信息'
            console.log(my_div.innerHTML)
        }
    </script>
</head>
<body>
    <div id="div-1">这是一个div-1</div>
</body>
</html>